<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>问卷统计</title>
    <link rel="stylesheet" href="${ctxPath}/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="${ctxPath}/assets/module/admin.css">
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<style>
   /* .layui-table-body.layui-table-main {
        height: 580px !important;
    }*/
    .layui-table th {
        background-color: rgb(199 217 234 / 78%); /* 设置表头的背景颜色 */
        color: #2e2e2e; /* 设置表头的文本颜色 */
        font-weight: bold;
    }

    .layui-table tbody tr:nth-child(odd) {
        background-color: #ffffff; /* 设置奇数行的背景颜色 */
    }

    .layui-table tbody tr:nth-child(even) {
        background-color: rgba(239, 239, 239, 0.94); /* 设置偶数行的背景颜色 */
    }
    .layui-table td, .layui-table th {
        border: 1px solid #e6e6e6; /* 边框颜色 */
    }
    .layui-table td, .layui-table th {
        border-width: 2px; /* 设置双边框效果 */
    }
</style>
<body>
<!-- 正文开始 -->
<div id="openStatisticsBox" style="padding: 5px;">
    <table id="dataTabels" lay-filter="dataTabels"></table>
</div>

<!-- js部分 -->
<script src="${ctxPath}/assets/libs/layui/layui.js"></script>
<script src="${ctxPath}/assets/js/common.js"></script>
<script>
    layui.use(['layer', 'table'], function () {
        var table = layui.table;

        var testpaperId = GetQueryString("testpaperId");
        var orgId = GetQueryString("orgId");
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }

        debugger;
        var insTb = table.render({
            elem: '#dataTabels',
            /*id: 'openStatisticsTable',*/
            height: 480,
            method: 'get', //接口http请求类型，默认：get
            url: getProjectUrl() + 'testpaper/interlocution',
            where: {
                testpaperId: testpaperId,
                orgId:orgId
            },
            toolbar: ['<p>',
                // '<button lay-event="answerAnisy" perm-show="testpaper:answerAnisy" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon">&#xe67d;</i>问答统计分析</button>&nbsp;',
                '</p>'].join(''),
            page: false, //是否分页
            limit: 10, //每页显示的条数
            limits: [10, 20, 30], //每页条数的选择项，默认：[10,20,30,40,50,60,70,80,90]。
            cols: [
                [
                    {field: 'number', title: '序号', type: 'numbers'},
                    {field: 'TITLE', title: '调查内容',  width:300,sort: false,},
                    {field: 'USERANSWER', title: '用户答案', sort: false},
                    {field: 'NAME', title: '用户名称', sort: false},
                ]
            ],
            done: function(res, curr, count) {
                // insTb.tableDone(insTb, res, curr, count);
            }
        });
    });
</script>
</body>
</html>
